﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类dImportSet
	/// </summary>
	[Serializable]
	public class dImportSet : Entity 
	{ 
		 public dImportSet() 
            : base("dImportSet") 
        { 

        }


		#region Model
		private int _UID;
		private string _ColumnCode;
		private string _ColumnName;
		private string _TableCode;
		private string _TableName;
		private string _FieldType;
		private string _ExcelColumn;
		private bool? _IsSelect;
		private int? _UserCreateID;
		private string _CreateDate;
		private int? _UserModifyID;
		private string _ModifyDate;
	 
		/// <summary>
		/// 
		/// </summary>
		public int UID
		{
			get{ return _UID; }
			set
			{
				this.OnPropertyValueChange(_.UID,_UID,value);
				this._UID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string ColumnCode
		{
			get{ return _ColumnCode; }
			set
			{
				this.OnPropertyValueChange(_.ColumnCode,_ColumnCode,value);
				this._ColumnCode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string ColumnName
		{
			get{ return _ColumnName; }
			set
			{
				this.OnPropertyValueChange(_.ColumnName,_ColumnName,value);
				this._ColumnName = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string TableCode
		{
			get{ return _TableCode; }
			set
			{
				this.OnPropertyValueChange(_.TableCode,_TableCode,value);
				this._TableCode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string TableName
		{
			get{ return _TableName; }
			set
			{
				this.OnPropertyValueChange(_.TableName,_TableName,value);
				this._TableName = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string FieldType
		{
			get{ return _FieldType; }
			set
			{
				this.OnPropertyValueChange(_.FieldType,_FieldType,value);
				this._FieldType = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string ExcelColumn
		{
			get{ return _ExcelColumn; }
			set
			{
				this.OnPropertyValueChange(_.ExcelColumn,_ExcelColumn,value);
				this._ExcelColumn = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public bool? IsSelect
		{
			get{ return _IsSelect; }
			set
			{
				this.OnPropertyValueChange(_.IsSelect,_IsSelect,value);
				this._IsSelect = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserCreateID
		{
			get{ return _UserCreateID; }
			set
			{
				this.OnPropertyValueChange(_.UserCreateID,_UserCreateID,value);
				this._UserCreateID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string CreateDate
		{
			get{ return _CreateDate; }
			set
			{
				this.OnPropertyValueChange(_.CreateDate,_CreateDate,value);
				this._CreateDate = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserModifyID
		{
			get{ return _UserModifyID; }
			set
			{
				this.OnPropertyValueChange(_.UserModifyID,_UserModifyID,value);
				this._UserModifyID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string ModifyDate
		{
			get{ return _ModifyDate; }
			set
			{
				this.OnPropertyValueChange(_.ModifyDate,_ModifyDate,value);
				this._ModifyDate = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的标识列
		/// </summary>
		public override Field GetIdentityField()
		{
			return _.UID;
		}
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.ColumnCode,				_.TableCode			};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.UID,
				_.ColumnCode,
				_.ColumnName,
				_.TableCode,
				_.TableName,
				_.FieldType,
				_.ExcelColumn,
				_.IsSelect,
				_.UserCreateID,
				_.CreateDate,
				_.UserModifyID,
				_.ModifyDate
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_UID,
				_ColumnCode,
				_ColumnName,
				_TableCode,
				_TableName,
				_FieldType,
				_ExcelColumn,
				_IsSelect,
				_UserCreateID,
				_CreateDate,
				_UserModifyID,
				_ModifyDate
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "UID":
                    this._UID = DataHelper.ConvertValue<int>(value);
                    break; 
				case "ColumnCode":
                    this._ColumnCode = DataHelper.ConvertValue<string>(value);
                    break; 
				case "ColumnName":
                    this._ColumnName = DataHelper.ConvertValue<string>(value);
                    break; 
				case "TableCode":
                    this._TableCode = DataHelper.ConvertValue<string>(value);
                    break; 
				case "TableName":
                    this._TableName = DataHelper.ConvertValue<string>(value);
                    break; 
				case "FieldType":
                    this._FieldType = DataHelper.ConvertValue<string>(value);
                    break; 
				case "ExcelColumn":
                    this._ExcelColumn = DataHelper.ConvertValue<string>(value);
                    break; 
				case "IsSelect":
                    this._IsSelect = DataHelper.ConvertValue<bool?>(value);
                    break; 
				case "UserCreateID":
                    this._UserCreateID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "CreateDate":
                    this._CreateDate = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserModifyID":
                    this._UserModifyID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "ModifyDate":
                    this._ModifyDate = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "UID":
                    return this._UID; 
				case "ColumnCode":
                    return this._ColumnCode; 
				case "ColumnName":
                    return this._ColumnName; 
				case "TableCode":
                    return this._TableCode; 
				case "TableName":
                    return this._TableName; 
				case "FieldType":
                    return this._FieldType; 
				case "ExcelColumn":
                    return this._ExcelColumn; 
				case "IsSelect":
                    return this._IsSelect; 
				case "UserCreateID":
                    return this._UserCreateID; 
				case "CreateDate":
                    return this._CreateDate; 
				case "UserModifyID":
                    return this._UserModifyID; 
				case "ModifyDate":
                    return this._ModifyDate; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","dImportSet");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UID = new Field("UID","dImportSet","UID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field ColumnCode = new Field("ColumnCode","dImportSet","ColumnCode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field ColumnName = new Field("ColumnName","dImportSet","ColumnName");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field TableCode = new Field("TableCode","dImportSet","TableCode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field TableName = new Field("TableName","dImportSet","TableName");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field FieldType = new Field("FieldType","dImportSet","FieldType");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field ExcelColumn = new Field("ExcelColumn","dImportSet","ExcelColumn");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field IsSelect = new Field("IsSelect","dImportSet","IsSelect");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserCreateID = new Field("UserCreateID","dImportSet","UserCreateID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field CreateDate = new Field("CreateDate","dImportSet","CreateDate");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserModifyID = new Field("UserModifyID","dImportSet","UserModifyID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field ModifyDate = new Field("ModifyDate","dImportSet","ModifyDate");
		}
		#endregion

 
	}
}

